feat: add macro integration tests and example file - #149
Merged
Conversation
Add examples/macros.vx demonstrating defmacro with unless and when macros. Add end-to-end compilation tests in lib.rs verifying macros compile through the full pipeline to Go. Add interpreter-based integration tests for defmacro expansion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/macros.vxdemonstratingdefmacrowithunlessandwhenmacroslib.rsverifying macros compile through the full pipeline (source → lex → parse → macro expand → type check → codegen → Go)defmacro_unless_via_interpreter,defmacro_when_via_interpreter,defmacro_double_via_interpreter) proving macros work through the interpreter pathTest plan
defmacro_unless_compiles— unless macro compiles to Godefmacro_when_compiles— when macro compiles to Godefmacro_stripped_from_go_output— defmacro forms absent from generated Godefmacro_with_hygiene_compiles— hygiene macro compiles correctlydefmacro_multiple_macros_compile— multiple macros in one filedefmacro_example_file_compiles— examples/macros.vx compiles end-to-enddefmacro_unless_via_interpreter— unless macro via interpreterdefmacro_when_via_interpreter— when macro via interpreterdefmacro_double_via_interpreter— double macro via interpretercargo clippy -- -D warningsclean